package com.jinmdz.fmis.dao.dao;

import com.jinmdz.fmis.dao.dao.provider.FarewellMournProvider;
import com.jinmdz.fmis.dao.model.farewell.FarewellMournViewItem;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.ArrayList;
import java.util.Date;

/**
 * 礼厅Dao
 *
 * @author LiCongLu
 * @date 2020-02-15 14:44
 */
public interface FarewellMournDao {

    /**
     * 按照主键获取礼厅信息
     *
     * @param id 主键
     * @return
     * @author LiCongLu
     * @date 2020-02-20 15:01
     */
    @SelectProvider(type = FarewellMournProvider.class, method = "getFarewellMournViewById")
    FarewellMournViewItem getFarewellMournViewById(@Param("id") Integer id);

    /**
     * 按照业务编码查询礼厅信息
     *
     * @param businessCode 业务编码
     * @return
     * @author LiCongLu
     * @date 2020-02-16 16:08
     */
    @SelectProvider(type = FarewellMournProvider.class, method = "listFarewellMournViewByBusinessCode")
    ArrayList<FarewellMournViewItem> listFarewellMournViewByBusinessCode(@Param("businessCode") String businessCode);

    /**
     * 通过预约时间等条件获取占用礼厅业务主键
     *
     * @param hallId             设备主键
     * @param businessId         原礼厅信息主键
     * @param outState           出厅状态
     * @param inState            入厅状态
     * @param appointmentInTime  新预约入藏时间
     * @param appointmentOutTime 新预约出藏时间
     * @return
     * @author LiCongLu
     * @date 2020-02-26 17:33
     */
    @SelectProvider(type = FarewellMournProvider.class, method = "getBusinessIdForHallId")
    @ResultType(Integer.class)
    Integer getBusinessIdForHallId(@Param("hallId") Integer hallId, @Param("businessId") Integer businessId, @Param("outState") Integer outState, @Param("inState") Integer inState, @Param("appointmentInTime") Date appointmentInTime, @Param("appointmentOutTime") Date appointmentOutTime);
}
